
package ui.adapter;

import android.content.Context;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;

import net.ck.hzq.R;

import java.util.ArrayList;
import java.util.List;

import Bean.JiFenRecordBean;
import Bean.PresentRecordBean;
import base.BaseViewHolder;
import base.SuperBaseAdapter;
import cn.finalteam.loadingviewfinal.RecyclerViewFinal;

/**
 * 提现列表适配器
 * Created by chenjian on 19/2/27.
 */
public class JiFenRecordAdapter extends SuperBaseAdapter<JiFenRecordBean> {

    List<JiFenRecordBean> mData;
    Context mContext;
    int mtype;

    public JiFenRecordAdapter(Context context, List<JiFenRecordBean> data,int type) {
        super(context, data);
        mContext = context;
        mData = data;
        mtype = type;
    }

    @Override
    protected void convert(BaseViewHolder holder, final JiFenRecordBean item, final int position) {
        holder.setText(R.id.getpresentrecord_txt1, item.getTimeTitle())
                .setText(R.id.getpresentrecord_txt2, "获得积分:"+item.getTotal());
        RecyclerViewFinal rv = holder.getView(R.id.refresh_rv);
        rv.setLayoutManager(new LinearLayoutManager(mContext));
        rv.setItemAnimator(new DefaultItemAnimator());
        JiFenAdapter adapter = new JiFenAdapter(mContext, item.getList(),mtype);
        rv.setAdapter(adapter);
    }


    @Override
    protected int getItemViewLayoutId(int position, JiFenRecordBean item) {
        return R.layout.listviewgetpresentrecord_item;
    }

}
